const { Position } = require('../utils/mongoUtil')

exports.savePosition = (data) => {
    return new Position(data).save()
}

exports.findPosList = () => {
    return Position.find().sort({publishTime: -1})
}

exports.deletePosById = (id) => {
    return Position.deleteOne({_id: id})
}

exports.findPosById = (id) => {
    return Position.where({_id: id}).findOne()
}

exports.updateById = (id, set) => {
    return Position.where({_id: id}).updateOne(set)
}







